home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlEditGetRECT.au3 < prev    next >
Text File  |  2007-09-08  |  934b  |  32 lines

  1. #include <GUIConstants.au3>
  2. #include <GuiEdit.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5.  
  6. Dim $myedit, $s_rect, $label_rect, $msg, $rect_array
  7.  
  8. GUICreate("Edit Get RECT", 392, 254)
  9.  
  10. $myedit = GUICtrlCreateEdit("First line" & @CRLF, 10, 32, 121, 97, BitOR($ES_AUTOVSCROLL, $WS_VSCROLL))
  11.  
  12. $s_rect = "Left:" & @LF & "Top:" & @LF & "Right:" & @LF & "Bottom:"
  13. $label_rect = GUICtrlCreateLabel($s_rect, 145, 50, 100, 55, $SS_SUNKEN)
  14.  
  15. GUISetState()
  16. $rect_array = _GUICtrlEditGetRECT ($myedit)
  17. If ($rect_array == $EC_ERR) Then
  18.     MsgBox(0, "Error", "Unable to Get RECT")
  19. ElseIf (IsArray($rect_array)) Then
  20.     $s_rect = "Left:" & $rect_array[1] & @LF & "Top:" & $rect_array[2] & @LF & "Right:" & $rect_array[3] & @LF & "Bottom:" & $rect_array[4]
  21.     GUICtrlSetData($label_rect, $s_rect)
  22. EndIf
  23.  
  24. ; Run the GUI until the dialog is closed
  25. While 1
  26.     $msg = GUIGetMsg()
  27.     Select
  28.         Case $msg = $GUI_EVENT_CLOSE
  29.             ExitLoop
  30.     EndSelect
  31. WEnd
  32.